<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>SFML - Simple and Fast Multimedia Library</title>
        <meta http-equiv="Content-Type" content="text/html;"/>
        <meta charset="utf-8"/>
        <!--<link rel='stylesheet' type='text/css' href="https://fonts.googleapis.com/css?family=Ubuntu:400,700,400italic"/>-->
        <link rel="stylesheet" type="text/css" href="doxygen.css" title="default" media="screen,print" />
        <script type="text/javascript" src="jquery.js"></script>
        <script type="text/javascript" src="dynsections.js"></script>
        <link rel="stylesheet" type="text/css" href="search/search.css" />
        <link rel="stylesheet" type="text/css" href="searchOverrides.css" />
        <script type="text/javascript" src="search/searchdata.js"></script>
        <script type="text/javascript" src="search/search.js"></script>
        <script type="text/javascript">
        /* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
          $(document).ready(function() { init_search(); });
        /* @license-end */
        </script>
    </head>
    <body>
        <div id="banner-container">
            <div id="banner">
                <span id="sfml">SFML 2.6.1</span>
            </div>
        </div>
        <div id="content">
<!-- Generated by Doxygen 1.9.7 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:d3d9a9a6595521f9666a5e94cc830dab83b65699&amp;dn=expat.txt MIT */
var searchBox = new SearchBox("searchBox", "search/",'.html');
/* @license-end */
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <span id="MSearchSelect"                onmouseover="return searchBox.OnSearchSelectShow()"                onmouseout="return searchBox.OnSearchSelectHide()">&#160;</span>
          <input type="text" id="MSearchField" value="" placeholder="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.svg" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<div id="MSearchResults">
<div class="SRPage">
<div id="SRIndex">
<div id="SRResults"></div>
<div class="SRStatus" id="Loading">Loading...</div>
<div class="SRStatus" id="Searching">Searching...</div>
<div class="SRStatus" id="NoMatches">No Matches</div>
</div>
</div>
</div>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><b>sf</b></li><li class="navelem"><a class="el" href="classsf_1_1Packet.html">Packet</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-methods">Protected Member Functions</a> &#124;
<a href="#friends">Friends</a> &#124;
<a href="classsf_1_1Packet-members.html">List of all members</a>  </div>
  <div class="headertitle"><div class="title">sf::Packet Class Reference<div class="ingroups"><a class="el" href="group__network.html">Network module</a></div></div></div>
</div><!--header-->
<div class="contents">

<p>Utility class to build blocks of data to transfer over the network.  
 <a href="classsf_1_1Packet.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="Packet_8hpp_source.html">SFML/Network/Packet.hpp</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pub-methods" name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a786e5d4ced83992ceefa1799963ea858"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a786e5d4ced83992ceefa1799963ea858">Packet</a> ()</td></tr>
<tr class="memdesc:a786e5d4ced83992ceefa1799963ea858"><td class="mdescLeft">&#160;</td><td class="mdescRight">Default constructor.  <br /></td></tr>
<tr class="separator:a786e5d4ced83992ceefa1799963ea858"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:adc0490ca3c7c3d1e321bd742e5213913"><td class="memItemLeft" align="right" valign="top">virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#adc0490ca3c7c3d1e321bd742e5213913">~Packet</a> ()</td></tr>
<tr class="memdesc:adc0490ca3c7c3d1e321bd742e5213913"><td class="mdescLeft">&#160;</td><td class="mdescRight">Virtual destructor.  <br /></td></tr>
<tr class="separator:adc0490ca3c7c3d1e321bd742e5213913"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7dd6e429b87520008326c4d71f1cf011"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a7dd6e429b87520008326c4d71f1cf011">append</a> (const void *data, std::size_t sizeInBytes)</td></tr>
<tr class="memdesc:a7dd6e429b87520008326c4d71f1cf011"><td class="mdescLeft">&#160;</td><td class="mdescRight">Append data to the end of the packet.  <br /></td></tr>
<tr class="separator:a7dd6e429b87520008326c4d71f1cf011"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5c2dc9878afaf30e88d922776201f6c3"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a5c2dc9878afaf30e88d922776201f6c3">getReadPosition</a> () const</td></tr>
<tr class="memdesc:a5c2dc9878afaf30e88d922776201f6c3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the current reading position in the packet.  <br /></td></tr>
<tr class="separator:a5c2dc9878afaf30e88d922776201f6c3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a133ea8b8fe6e93c230f0d79f19a3bf0d"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a133ea8b8fe6e93c230f0d79f19a3bf0d">clear</a> ()</td></tr>
<tr class="memdesc:a133ea8b8fe6e93c230f0d79f19a3bf0d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clear the packet.  <br /></td></tr>
<tr class="separator:a133ea8b8fe6e93c230f0d79f19a3bf0d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a998b70df024bee4792e2ecdc915ae46e"><td class="memItemLeft" align="right" valign="top">const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a998b70df024bee4792e2ecdc915ae46e">getData</a> () const</td></tr>
<tr class="memdesc:a998b70df024bee4792e2ecdc915ae46e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get a pointer to the data contained in the packet.  <br /></td></tr>
<tr class="separator:a998b70df024bee4792e2ecdc915ae46e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a0fae6eccf2ca704fc5099cd90a9f56f7"><td class="memItemLeft" align="right" valign="top">std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a0fae6eccf2ca704fc5099cd90a9f56f7">getDataSize</a> () const</td></tr>
<tr class="memdesc:a0fae6eccf2ca704fc5099cd90a9f56f7"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the size of the data contained in the packet.  <br /></td></tr>
<tr class="separator:a0fae6eccf2ca704fc5099cd90a9f56f7"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a61e354fa670da053907c14b738839560"><td class="memItemLeft" align="right" valign="top">bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a61e354fa670da053907c14b738839560">endOfPacket</a> () const</td></tr>
<tr class="memdesc:a61e354fa670da053907c14b738839560"><td class="mdescLeft">&#160;</td><td class="mdescRight">Tell if the reading position has reached the end of the packet.  <br /></td></tr>
<tr class="separator:a61e354fa670da053907c14b738839560"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8ab20be4a63921b7cb1a4d8ca5c30f75"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a8ab20be4a63921b7cb1a4d8ca5c30f75">operator BoolType</a> () const</td></tr>
<tr class="memdesc:a8ab20be4a63921b7cb1a4d8ca5c30f75"><td class="mdescLeft">&#160;</td><td class="mdescRight">Test the validity of the packet, for reading.  <br /></td></tr>
<tr class="separator:a8ab20be4a63921b7cb1a4d8ca5c30f75"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8b6403506fec6b69f033278de33c8145"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a8b6403506fec6b69f033278de33c8145">operator&gt;&gt;</a> (bool &amp;data)</td></tr>
<tr class="memdesc:a8b6403506fec6b69f033278de33c8145"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of operator &gt;&gt; to read data from the packet.  <br /></td></tr>
<tr class="separator:a8b6403506fec6b69f033278de33c8145"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1c7814f9dbc637986ac498094add5ca5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a1c7814f9dbc637986ac498094add5ca5">operator&gt;&gt;</a> (Int8 &amp;data)</td></tr>
<tr class="memdesc:a1c7814f9dbc637986ac498094add5ca5"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a1c7814f9dbc637986ac498094add5ca5"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a48df8986fc24551f1287144d3e990859"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a48df8986fc24551f1287144d3e990859">operator&gt;&gt;</a> (Uint8 &amp;data)</td></tr>
<tr class="memdesc:a48df8986fc24551f1287144d3e990859"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a48df8986fc24551f1287144d3e990859"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae455be24bfd8dbaa4cd5097e0fb70ecd"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ae455be24bfd8dbaa4cd5097e0fb70ecd">operator&gt;&gt;</a> (Int16 &amp;data)</td></tr>
<tr class="memdesc:ae455be24bfd8dbaa4cd5097e0fb70ecd"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:ae455be24bfd8dbaa4cd5097e0fb70ecd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6bc20f1be9a63407079e6d26171ac71f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a6bc20f1be9a63407079e6d26171ac71f">operator&gt;&gt;</a> (Uint16 &amp;data)</td></tr>
<tr class="memdesc:a6bc20f1be9a63407079e6d26171ac71f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a6bc20f1be9a63407079e6d26171ac71f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a663e71b25a9352e3c4ddf4a3ce9db921"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a663e71b25a9352e3c4ddf4a3ce9db921">operator&gt;&gt;</a> (Int32 &amp;data)</td></tr>
<tr class="memdesc:a663e71b25a9352e3c4ddf4a3ce9db921"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a663e71b25a9352e3c4ddf4a3ce9db921"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa3b0fabe6c14bcfa29bb04844b8bb987"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#aa3b0fabe6c14bcfa29bb04844b8bb987">operator&gt;&gt;</a> (Uint32 &amp;data)</td></tr>
<tr class="memdesc:aa3b0fabe6c14bcfa29bb04844b8bb987"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:aa3b0fabe6c14bcfa29bb04844b8bb987"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae76105996a6c2217bb3a4571603e92f6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ae76105996a6c2217bb3a4571603e92f6">operator&gt;&gt;</a> (Int64 &amp;data)</td></tr>
<tr class="memdesc:ae76105996a6c2217bb3a4571603e92f6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:ae76105996a6c2217bb3a4571603e92f6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a79f7c144fd07a4036ffc7b0870a36613"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a79f7c144fd07a4036ffc7b0870a36613">operator&gt;&gt;</a> (Uint64 &amp;data)</td></tr>
<tr class="memdesc:a79f7c144fd07a4036ffc7b0870a36613"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a79f7c144fd07a4036ffc7b0870a36613"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a741849607d428e93c532e11eadcc39f1"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a741849607d428e93c532e11eadcc39f1">operator&gt;&gt;</a> (float &amp;data)</td></tr>
<tr class="memdesc:a741849607d428e93c532e11eadcc39f1"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a741849607d428e93c532e11eadcc39f1"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1854ca771105fb281edf349fc6507c73"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a1854ca771105fb281edf349fc6507c73">operator&gt;&gt;</a> (double &amp;data)</td></tr>
<tr class="memdesc:a1854ca771105fb281edf349fc6507c73"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a1854ca771105fb281edf349fc6507c73"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aaed01fec1a3eae27a028506195607f82"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#aaed01fec1a3eae27a028506195607f82">operator&gt;&gt;</a> (char *data)</td></tr>
<tr class="memdesc:aaed01fec1a3eae27a028506195607f82"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:aaed01fec1a3eae27a028506195607f82"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a60484dff69997db11e2d4ab3704ab921"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a60484dff69997db11e2d4ab3704ab921">operator&gt;&gt;</a> (std::string &amp;data)</td></tr>
<tr class="memdesc:a60484dff69997db11e2d4ab3704ab921"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a60484dff69997db11e2d4ab3704ab921"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8805e66013f9f84ec8a883e42ae259d4"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a8805e66013f9f84ec8a883e42ae259d4">operator&gt;&gt;</a> (wchar_t *data)</td></tr>
<tr class="memdesc:a8805e66013f9f84ec8a883e42ae259d4"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a8805e66013f9f84ec8a883e42ae259d4"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8621056995c32bcf59809e2aecf08635"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a8621056995c32bcf59809e2aecf08635">operator&gt;&gt;</a> (std::wstring &amp;data)</td></tr>
<tr class="memdesc:a8621056995c32bcf59809e2aecf08635"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a8621056995c32bcf59809e2aecf08635"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a27d0ae92891dbf8a7914e5d5232940d0"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a27d0ae92891dbf8a7914e5d5232940d0">operator&gt;&gt;</a> (<a class="el" href="classsf_1_1String.html">String</a> &amp;data)</td></tr>
<tr class="memdesc:a27d0ae92891dbf8a7914e5d5232940d0"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a27d0ae92891dbf8a7914e5d5232940d0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae02c874e0aac18a0497fca982a8f9083"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ae02c874e0aac18a0497fca982a8f9083">operator&lt;&lt;</a> (bool data)</td></tr>
<tr class="memdesc:ae02c874e0aac18a0497fca982a8f9083"><td class="mdescLeft">&#160;</td><td class="mdescRight">Overload of operator &lt;&lt; to write data into the packet.  <br /></td></tr>
<tr class="separator:ae02c874e0aac18a0497fca982a8f9083"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97aa4ecba66b8f528438fc41ed020825"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a97aa4ecba66b8f528438fc41ed020825">operator&lt;&lt;</a> (Int8 data)</td></tr>
<tr class="memdesc:a97aa4ecba66b8f528438fc41ed020825"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a97aa4ecba66b8f528438fc41ed020825"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad5cc1857ed14878ab7a8509db8d99335"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ad5cc1857ed14878ab7a8509db8d99335">operator&lt;&lt;</a> (Uint8 data)</td></tr>
<tr class="memdesc:ad5cc1857ed14878ab7a8509db8d99335"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:ad5cc1857ed14878ab7a8509db8d99335"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9d9c5a1bef415046aa46d51e7d2a9f1c"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a9d9c5a1bef415046aa46d51e7d2a9f1c">operator&lt;&lt;</a> (Int16 data)</td></tr>
<tr class="memdesc:a9d9c5a1bef415046aa46d51e7d2a9f1c"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a9d9c5a1bef415046aa46d51e7d2a9f1c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afb6b2958f8a55923297da432c2a4f3e9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#afb6b2958f8a55923297da432c2a4f3e9">operator&lt;&lt;</a> (Uint16 data)</td></tr>
<tr class="memdesc:afb6b2958f8a55923297da432c2a4f3e9"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:afb6b2958f8a55923297da432c2a4f3e9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af7f5c31c2d2749d3088783525f9fc974"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#af7f5c31c2d2749d3088783525f9fc974">operator&lt;&lt;</a> (Int32 data)</td></tr>
<tr class="memdesc:af7f5c31c2d2749d3088783525f9fc974"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:af7f5c31c2d2749d3088783525f9fc974"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad1837e0990f71e3727e0e118ab9fd20e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ad1837e0990f71e3727e0e118ab9fd20e">operator&lt;&lt;</a> (Uint32 data)</td></tr>
<tr class="memdesc:ad1837e0990f71e3727e0e118ab9fd20e"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:ad1837e0990f71e3727e0e118ab9fd20e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dc89edcfcf19daf781b776439aba94a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a6dc89edcfcf19daf781b776439aba94a">operator&lt;&lt;</a> (Int64 data)</td></tr>
<tr class="memdesc:a6dc89edcfcf19daf781b776439aba94a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a6dc89edcfcf19daf781b776439aba94a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:af3802406ed3430e20259e8551fa6554b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#af3802406ed3430e20259e8551fa6554b">operator&lt;&lt;</a> (Uint64 data)</td></tr>
<tr class="memdesc:af3802406ed3430e20259e8551fa6554b"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:af3802406ed3430e20259e8551fa6554b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acf1a231e48452a1cd55af2c027a1c1ee"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#acf1a231e48452a1cd55af2c027a1c1ee">operator&lt;&lt;</a> (float data)</td></tr>
<tr class="memdesc:acf1a231e48452a1cd55af2c027a1c1ee"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:acf1a231e48452a1cd55af2c027a1c1ee"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abee2df335bdc3ab40521248cdb187c02"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#abee2df335bdc3ab40521248cdb187c02">operator&lt;&lt;</a> (double data)</td></tr>
<tr class="memdesc:abee2df335bdc3ab40521248cdb187c02"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:abee2df335bdc3ab40521248cdb187c02"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94522071d95189ddff1ae7ca832695ff"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a94522071d95189ddff1ae7ca832695ff">operator&lt;&lt;</a> (const char *data)</td></tr>
<tr class="memdesc:a94522071d95189ddff1ae7ca832695ff"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a94522071d95189ddff1ae7ca832695ff"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac45aab054ddee7de9599bc3b2d8e025f"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ac45aab054ddee7de9599bc3b2d8e025f">operator&lt;&lt;</a> (const std::string &amp;data)</td></tr>
<tr class="memdesc:ac45aab054ddee7de9599bc3b2d8e025f"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:ac45aab054ddee7de9599bc3b2d8e025f"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac5a13e3280cac77799f7fdadfe3e37b6"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ac5a13e3280cac77799f7fdadfe3e37b6">operator&lt;&lt;</a> (const wchar_t *data)</td></tr>
<tr class="memdesc:ac5a13e3280cac77799f7fdadfe3e37b6"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:ac5a13e3280cac77799f7fdadfe3e37b6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a97acaefaee7d3ffb36f4e8a00d4c3970"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a97acaefaee7d3ffb36f4e8a00d4c3970">operator&lt;&lt;</a> (const std::wstring &amp;data)</td></tr>
<tr class="memdesc:a97acaefaee7d3ffb36f4e8a00d4c3970"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a97acaefaee7d3ffb36f4e8a00d4c3970"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5ef2e3308b93b80214b42a7d4683704a"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#a5ef2e3308b93b80214b42a7d4683704a">operator&lt;&lt;</a> (const <a class="el" href="classsf_1_1String.html">String</a> &amp;data)</td></tr>
<tr class="memdesc:a5ef2e3308b93b80214b42a7d4683704a"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.  <br /></td></tr>
<tr class="separator:a5ef2e3308b93b80214b42a7d4683704a"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="pro-methods" name="pro-methods"></a>
Protected Member Functions</h2></td></tr>
<tr class="memitem:af0003506bcb290407dcf5fe7f13a887d"><td class="memItemLeft" align="right" valign="top">virtual const void *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#af0003506bcb290407dcf5fe7f13a887d">onSend</a> (std::size_t &amp;size)</td></tr>
<tr class="memdesc:af0003506bcb290407dcf5fe7f13a887d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called before the packet is sent over the network.  <br /></td></tr>
<tr class="separator:af0003506bcb290407dcf5fe7f13a887d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab71a31ef0f1d5d856de6f9fc75434128"><td class="memItemLeft" align="right" valign="top">virtual void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ab71a31ef0f1d5d856de6f9fc75434128">onReceive</a> (const void *data, std::size_t size)</td></tr>
<tr class="memdesc:ab71a31ef0f1d5d856de6f9fc75434128"><td class="mdescLeft">&#160;</td><td class="mdescRight">Called after the packet is received over the network.  <br /></td></tr>
<tr class="separator:ab71a31ef0f1d5d856de6f9fc75434128"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a id="friends" name="friends"></a>
Friends</h2></td></tr>
<tr class="memitem:aa8b32310b01d4bb702d6bcb969d5f130"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#aa8b32310b01d4bb702d6bcb969d5f130">TcpSocket</a></td></tr>
<tr class="separator:aa8b32310b01d4bb702d6bcb969d5f130"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ae128c6687ced82c6157c5f865f8dec5c"><td class="memItemLeft" align="right" valign="top">class&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classsf_1_1Packet.html#ae128c6687ced82c6157c5f865f8dec5c">UdpSocket</a></td></tr>
<tr class="separator:ae128c6687ced82c6157c5f865f8dec5c"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Utility class to build blocks of data to transfer over the network. </p>
<p>Packets provide a safe and easy way to serialize data, in order to send it over the network using sockets (<a class="el" href="classsf_1_1TcpSocket.html" title="Specialized socket using the TCP protocol.">sf::TcpSocket</a>, <a class="el" href="classsf_1_1UdpSocket.html" title="Specialized socket using the UDP protocol.">sf::UdpSocket</a>).</p>
<p>Packets solve 2 fundamental problems that arise when transferring data over the network: </p><ul>
<li>data is interpreted correctly according to the endianness </li>
<li>the bounds of the packet are preserved (one send == one receive)</li>
</ul>
<p>The <a class="el" href="classsf_1_1Packet.html" title="Utility class to build blocks of data to transfer over the network.">sf::Packet</a> class provides both input and output modes. It is designed to follow the behavior of standard C++ streams, using operators &gt;&gt; and &lt;&lt; to extract and insert data.</p>
<p>It is recommended to use only fixed-size types (like sf::Int32, etc.), to avoid possible differences between the sender and the receiver. Indeed, the native C++ types may have different sizes on two platforms and your data may be corrupted if that happens.</p>
<p>Usage example: </p><div class="fragment"><div class="line">sf::Uint32 x = 24;</div>
<div class="line">std::string s = <span class="stringliteral">&quot;hello&quot;</span>;</div>
<div class="line"><span class="keywordtype">double</span> d = 5.89;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Group the variables to send into a packet</span></div>
<div class="line"><a class="code hl_class" href="classsf_1_1Packet.html">sf::Packet</a> packet;</div>
<div class="line">packet &lt;&lt; x &lt;&lt; s &lt;&lt; d;</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Send it over the network (socket is a valid sf::TcpSocket)</span></div>
<div class="line">socket.send(packet);</div>
<div class="line"> </div>
<div class="line">-----------------------------------------------------------------</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Receive the packet at the other end</span></div>
<div class="line"><a class="code hl_class" href="classsf_1_1Packet.html">sf::Packet</a> packet;</div>
<div class="line">socket.receive(packet);</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Extract the variables contained in the packet</span></div>
<div class="line">sf::Uint32 x;</div>
<div class="line">std::string s;</div>
<div class="line"><span class="keywordtype">double</span> d;</div>
<div class="line"><span class="keywordflow">if</span> (packet &gt;&gt; x &gt;&gt; s &gt;&gt; d)</div>
<div class="line">{</div>
<div class="line">    <span class="comment">// Data extracted successfully...</span></div>
<div class="line">}</div>
<div class="ttc" id="aclasssf_1_1Packet_html"><div class="ttname"><a href="classsf_1_1Packet.html">sf::Packet</a></div><div class="ttdoc">Utility class to build blocks of data to transfer over the network.</div><div class="ttdef"><b>Definition</b> <a href="Packet_8hpp_source.html#l00047">Packet.hpp:48</a></div></div>
</div><!-- fragment --><p>Packets have built-in operator &gt;&gt; and &lt;&lt; overloads for standard types: </p><ul>
<li>bool </li>
<li>fixed-size integer types (sf::Int8/16/32, sf::Uint8/16/32) </li>
<li>floating point numbers (float, double) </li>
<li>string types (char*, wchar_t*, std::string, std::wstring, <a class="el" href="classsf_1_1String.html" title="Utility string class that automatically handles conversions between types and encodings.">sf::String</a>)</li>
</ul>
<p>Like standard streams, it is also possible to define your own overloads of operators &gt;&gt; and &lt;&lt; in order to handle your custom types.</p>
<div class="fragment"><div class="line"><span class="keyword">struct </span>MyStruct</div>
<div class="line">{</div>
<div class="line">    <span class="keywordtype">float</span>       number;</div>
<div class="line">    sf::Int8    integer;</div>
<div class="line">    std::string str;</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><a class="code hl_class" href="classsf_1_1Packet.html">sf::Packet</a>&amp; <a class="code hl_function" href="classsf_1_1Packet.html#ae02c874e0aac18a0497fca982a8f9083">operator &lt;&lt;</a>(<a class="code hl_class" href="classsf_1_1Packet.html">sf::Packet</a>&amp; packet, <span class="keyword">const</span> MyStruct&amp; m)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">return</span> packet &lt;&lt; m.number &lt;&lt; m.integer &lt;&lt; m.str;</div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><a class="code hl_class" href="classsf_1_1Packet.html">sf::Packet</a>&amp; <a class="code hl_function" href="classsf_1_1Packet.html#a8b6403506fec6b69f033278de33c8145">operator &gt;&gt;</a>(<a class="code hl_class" href="classsf_1_1Packet.html">sf::Packet</a>&amp; packet, MyStruct&amp; m)</div>
<div class="line">{</div>
<div class="line">    <span class="keywordflow">return</span> packet &gt;&gt; m.number &gt;&gt; m.integer &gt;&gt; m.str;</div>
<div class="line">}</div>
<div class="ttc" id="aclasssf_1_1Packet_html_a8b6403506fec6b69f033278de33c8145"><div class="ttname"><a href="classsf_1_1Packet.html#a8b6403506fec6b69f033278de33c8145">sf::Packet::operator&gt;&gt;</a></div><div class="ttdeci">Packet &amp; operator&gt;&gt;(bool &amp;data)</div><div class="ttdoc">Overload of operator &gt;&gt; to read data from the packet.</div></div>
<div class="ttc" id="aclasssf_1_1Packet_html_ae02c874e0aac18a0497fca982a8f9083"><div class="ttname"><a href="classsf_1_1Packet.html#ae02c874e0aac18a0497fca982a8f9083">sf::Packet::operator&lt;&lt;</a></div><div class="ttdeci">Packet &amp; operator&lt;&lt;(bool data)</div><div class="ttdoc">Overload of operator &lt;&lt; to write data into the packet.</div></div>
</div><!-- fragment --><p>Packets also provide an extra feature that allows to apply custom transformations to the data before it is sent, and after it is received. This is typically used to handle automatic compression or encryption of the data. This is achieved by inheriting from <a class="el" href="classsf_1_1Packet.html" title="Utility class to build blocks of data to transfer over the network.">sf::Packet</a>, and overriding the onSend and onReceive functions.</p>
<p>Here is an example: </p><div class="fragment"><div class="line"><span class="keyword">class </span>ZipPacket : <span class="keyword">public</span> <a class="code hl_class" href="classsf_1_1Packet.html">sf::Packet</a></div>
<div class="line">{</div>
<div class="line">    <span class="keyword">virtual</span> <span class="keyword">const</span> <span class="keywordtype">void</span>* onSend(std::size_t&amp; size)</div>
<div class="line">    {</div>
<div class="line">        <span class="keyword">const</span> <span class="keywordtype">void</span>* srcData = getData();</div>
<div class="line">        std::size_t srcSize = getDataSize();</div>
<div class="line"> </div>
<div class="line">        <span class="keywordflow">return</span> MySuperZipFunction(srcData, srcSize, &amp;size);</div>
<div class="line">    }</div>
<div class="line"> </div>
<div class="line">    <span class="keyword">virtual</span> <span class="keywordtype">void</span> onReceive(<span class="keyword">const</span> <span class="keywordtype">void</span>* data, std::size_t size)</div>
<div class="line">    {</div>
<div class="line">        std::size_t dstSize;</div>
<div class="line">        <span class="keyword">const</span> <span class="keywordtype">void</span>* dstData = MySuperUnzipFunction(data, size, &amp;dstSize);</div>
<div class="line"> </div>
<div class="line">        append(dstData, dstSize);</div>
<div class="line">    }</div>
<div class="line">};</div>
<div class="line"> </div>
<div class="line"><span class="comment">// Use like regular packets:</span></div>
<div class="line">ZipPacket packet;</div>
<div class="line">packet &lt;&lt; x &lt;&lt; s &lt;&lt; d;</div>
<div class="line">...</div>
</div><!-- fragment --><dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1TcpSocket.html" title="Specialized socket using the TCP protocol.">sf::TcpSocket</a>, <a class="el" href="classsf_1_1UdpSocket.html" title="Specialized socket using the UDP protocol.">sf::UdpSocket</a> </dd></dl>

<p class="definition">Definition at line <a class="el" href="Packet_8hpp_source.html#l00047">47</a> of file <a class="el" href="Packet_8hpp_source.html">Packet.hpp</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a id="a786e5d4ced83992ceefa1799963ea858" name="a786e5d4ced83992ceefa1799963ea858"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a786e5d4ced83992ceefa1799963ea858">&#9670;&#160;</a></span>Packet()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::Packet::Packet </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Default constructor. </p>
<p>Creates an empty packet. </p>

</div>
</div>
<a id="adc0490ca3c7c3d1e321bd742e5213913" name="adc0490ca3c7c3d1e321bd742e5213913"></a>
<h2 class="memtitle"><span class="permalink"><a href="#adc0490ca3c7c3d1e321bd742e5213913">&#9670;&#160;</a></span>~Packet()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual sf::Packet::~Packet </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Virtual destructor. </p>

</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a id="a7dd6e429b87520008326c4d71f1cf011" name="a7dd6e429b87520008326c4d71f1cf011"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a7dd6e429b87520008326c4d71f1cf011">&#9670;&#160;</a></span>append()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Packet::append </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>sizeInBytes</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Append data to the end of the packet. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>Pointer to the sequence of bytes to append </td></tr>
    <tr><td class="paramname">sizeInBytes</td><td>Number of bytes to append</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#a133ea8b8fe6e93c230f0d79f19a3bf0d" title="Clear the packet.">clear</a> </dd>
<dd>
<a class="el" href="classsf_1_1Packet.html#a5c2dc9878afaf30e88d922776201f6c3" title="Get the current reading position in the packet.">getReadPosition</a> </dd></dl>

</div>
</div>
<a id="a133ea8b8fe6e93c230f0d79f19a3bf0d" name="a133ea8b8fe6e93c230f0d79f19a3bf0d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a133ea8b8fe6e93c230f0d79f19a3bf0d">&#9670;&#160;</a></span>clear()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void sf::Packet::clear </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Clear the packet. </p>
<p>After calling Clear, the packet is empty.</p>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#a7dd6e429b87520008326c4d71f1cf011" title="Append data to the end of the packet.">append</a> </dd></dl>

</div>
</div>
<a id="a61e354fa670da053907c14b738839560" name="a61e354fa670da053907c14b738839560"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a61e354fa670da053907c14b738839560">&#9670;&#160;</a></span>endOfPacket()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">bool sf::Packet::endOfPacket </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Tell if the reading position has reached the end of the packet. </p>
<p>This function is useful to know if there is some data left to be read, without actually reading it.</p>
<dl class="section return"><dt>Returns</dt><dd>True if all data was read, false otherwise</dd></dl>
<dl class="section see"><dt>See also</dt><dd>operator bool </dd></dl>

</div>
</div>
<a id="a998b70df024bee4792e2ecdc915ae46e" name="a998b70df024bee4792e2ecdc915ae46e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a998b70df024bee4792e2ecdc915ae46e">&#9670;&#160;</a></span>getData()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">const void * sf::Packet::getData </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get a pointer to the data contained in the packet. </p>
<p>Warning: the returned pointer may become invalid after you append data to the packet, therefore it should never be stored. The return pointer is NULL if the packet is empty.</p>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the data</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#a0fae6eccf2ca704fc5099cd90a9f56f7" title="Get the size of the data contained in the packet.">getDataSize</a> </dd></dl>

</div>
</div>
<a id="a0fae6eccf2ca704fc5099cd90a9f56f7" name="a0fae6eccf2ca704fc5099cd90a9f56f7"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a0fae6eccf2ca704fc5099cd90a9f56f7">&#9670;&#160;</a></span>getDataSize()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t sf::Packet::getDataSize </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the size of the data contained in the packet. </p>
<p>This function returns the number of bytes pointed to by what getData returns.</p>
<dl class="section return"><dt>Returns</dt><dd>Data size, in bytes</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#a998b70df024bee4792e2ecdc915ae46e" title="Get a pointer to the data contained in the packet.">getData</a> </dd></dl>

</div>
</div>
<a id="a5c2dc9878afaf30e88d922776201f6c3" name="a5c2dc9878afaf30e88d922776201f6c3"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5c2dc9878afaf30e88d922776201f6c3">&#9670;&#160;</a></span>getReadPosition()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">std::size_t sf::Packet::getReadPosition </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Get the current reading position in the packet. </p>
<p>The next read operation will read data from this position</p>
<dl class="section return"><dt>Returns</dt><dd>The byte offset of the current read position</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#a7dd6e429b87520008326c4d71f1cf011" title="Append data to the end of the packet.">append</a> </dd></dl>

</div>
</div>
<a id="ab71a31ef0f1d5d856de6f9fc75434128" name="ab71a31ef0f1d5d856de6f9fc75434128"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab71a31ef0f1d5d856de6f9fc75434128">&#9670;&#160;</a></span>onReceive()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual void sf::Packet::onReceive </td>
          <td>(</td>
          <td class="paramtype">const void *&#160;</td>
          <td class="paramname"><em>data</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">std::size_t&#160;</td>
          <td class="paramname"><em>size</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called after the packet is received over the network. </p>
<p>This function can be defined by derived classes to transform the data after it is received; this can be used for decompression, decryption, etc. The function receives a pointer to the received data, and must fill the packet with the transformed bytes. The default implementation fills the packet directly without transforming the data.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">data</td><td>Pointer to the received bytes </td></tr>
    <tr><td class="paramname">size</td><td>Number of bytes</td></tr>
  </table>
  </dd>
</dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#af0003506bcb290407dcf5fe7f13a887d" title="Called before the packet is sent over the network.">onSend</a> </dd></dl>

</div>
</div>
<a id="af0003506bcb290407dcf5fe7f13a887d" name="af0003506bcb290407dcf5fe7f13a887d"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af0003506bcb290407dcf5fe7f13a887d">&#9670;&#160;</a></span>onSend()</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual const void * sf::Packet::onSend </td>
          <td>(</td>
          <td class="paramtype">std::size_t &amp;&#160;</td>
          <td class="paramname"><em>size</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">protected</span><span class="mlabel">virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Called before the packet is sent over the network. </p>
<p>This function can be defined by derived classes to transform the data before it is sent; this can be used for compression, encryption, etc. The function must return a pointer to the modified data, as well as the number of bytes pointed. The default implementation provides the packet's data without transforming it.</p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">size</td><td>Variable to fill with the size of data to send</td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>Pointer to the array of bytes to send</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#ab71a31ef0f1d5d856de6f9fc75434128" title="Called after the packet is received over the network.">onReceive</a> </dd></dl>

</div>
</div>
<a id="a8ab20be4a63921b7cb1a4d8ca5c30f75" name="a8ab20be4a63921b7cb1a4d8ca5c30f75"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8ab20be4a63921b7cb1a4d8ca5c30f75">&#9670;&#160;</a></span>operator BoolType()</h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">sf::Packet::operator BoolType </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Test the validity of the packet, for reading. </p>
<p>This operator allows to test the packet as a boolean variable, to check if a reading operation was successful.</p>
<p>A packet will be in an invalid state if it has no more data to read.</p>
<p>This behavior is the same as standard C++ streams.</p>
<p>Usage example: </p><div class="fragment"><div class="line"><span class="keywordtype">float</span> x;</div>
<div class="line">packet &gt;&gt; x;</div>
<div class="line"><span class="keywordflow">if</span> (packet)</div>
<div class="line">{</div>
<div class="line">   <span class="comment">// ok, x was extracted successfully</span></div>
<div class="line">}</div>
<div class="line"> </div>
<div class="line"><span class="comment">// -- or --</span></div>
<div class="line"> </div>
<div class="line"><span class="keywordtype">float</span> x;</div>
<div class="line"><span class="keywordflow">if</span> (packet &gt;&gt; x)</div>
<div class="line">{</div>
<div class="line">   <span class="comment">// ok, x was extracted successfully</span></div>
<div class="line">}</div>
</div><!-- fragment --><p>Don't focus on the return type, it's equivalent to bool but it disallows unwanted implicit conversions to integer or pointer types.</p>
<dl class="section return"><dt>Returns</dt><dd>True if last data extraction from packet was successful</dd></dl>
<dl class="section see"><dt>See also</dt><dd><a class="el" href="classsf_1_1Packet.html#a61e354fa670da053907c14b738839560" title="Tell if the reading position has reached the end of the packet.">endOfPacket</a> </dd></dl>

</div>
</div>
<a id="ae02c874e0aac18a0497fca982a8f9083" name="ae02c874e0aac18a0497fca982a8f9083"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae02c874e0aac18a0497fca982a8f9083">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[1/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">bool&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Overload of operator &lt;&lt; to write data into the packet. </p>

</div>
</div>
<a id="a94522071d95189ddff1ae7ca832695ff" name="a94522071d95189ddff1ae7ca832695ff"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a94522071d95189ddff1ae7ca832695ff">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[2/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="ac45aab054ddee7de9599bc3b2d8e025f" name="ac45aab054ddee7de9599bc3b2d8e025f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac45aab054ddee7de9599bc3b2d8e025f">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[3/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">const std::string &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a97acaefaee7d3ffb36f4e8a00d4c3970" name="a97acaefaee7d3ffb36f4e8a00d4c3970"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a97acaefaee7d3ffb36f4e8a00d4c3970">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[4/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">const std::wstring &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a5ef2e3308b93b80214b42a7d4683704a" name="a5ef2e3308b93b80214b42a7d4683704a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a5ef2e3308b93b80214b42a7d4683704a">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[5/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classsf_1_1String.html">String</a> &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="ac5a13e3280cac77799f7fdadfe3e37b6" name="ac5a13e3280cac77799f7fdadfe3e37b6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ac5a13e3280cac77799f7fdadfe3e37b6">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[6/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">const wchar_t *&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="abee2df335bdc3ab40521248cdb187c02" name="abee2df335bdc3ab40521248cdb187c02"></a>
<h2 class="memtitle"><span class="permalink"><a href="#abee2df335bdc3ab40521248cdb187c02">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[7/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">double&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="acf1a231e48452a1cd55af2c027a1c1ee" name="acf1a231e48452a1cd55af2c027a1c1ee"></a>
<h2 class="memtitle"><span class="permalink"><a href="#acf1a231e48452a1cd55af2c027a1c1ee">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[8/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">float&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a9d9c5a1bef415046aa46d51e7d2a9f1c" name="a9d9c5a1bef415046aa46d51e7d2a9f1c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a9d9c5a1bef415046aa46d51e7d2a9f1c">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[9/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Int16&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="af7f5c31c2d2749d3088783525f9fc974" name="af7f5c31c2d2749d3088783525f9fc974"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af7f5c31c2d2749d3088783525f9fc974">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[10/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Int32&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a6dc89edcfcf19daf781b776439aba94a" name="a6dc89edcfcf19daf781b776439aba94a"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6dc89edcfcf19daf781b776439aba94a">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[11/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Int64&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a97aa4ecba66b8f528438fc41ed020825" name="a97aa4ecba66b8f528438fc41ed020825"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a97aa4ecba66b8f528438fc41ed020825">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[12/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Int8&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="afb6b2958f8a55923297da432c2a4f3e9" name="afb6b2958f8a55923297da432c2a4f3e9"></a>
<h2 class="memtitle"><span class="permalink"><a href="#afb6b2958f8a55923297da432c2a4f3e9">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[13/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Uint16&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="ad1837e0990f71e3727e0e118ab9fd20e" name="ad1837e0990f71e3727e0e118ab9fd20e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad1837e0990f71e3727e0e118ab9fd20e">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[14/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Uint32&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="af3802406ed3430e20259e8551fa6554b" name="af3802406ed3430e20259e8551fa6554b"></a>
<h2 class="memtitle"><span class="permalink"><a href="#af3802406ed3430e20259e8551fa6554b">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[15/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Uint64&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="ad5cc1857ed14878ab7a8509db8d99335" name="ad5cc1857ed14878ab7a8509db8d99335"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad5cc1857ed14878ab7a8509db8d99335">&#9670;&#160;</a></span>operator&lt;&lt;() <span class="overload">[16/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&lt;&lt; </td>
          <td>(</td>
          <td class="paramtype">Uint8&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a8b6403506fec6b69f033278de33c8145" name="a8b6403506fec6b69f033278de33c8145"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8b6403506fec6b69f033278de33c8145">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[1/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">bool &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Overload of operator &gt;&gt; to read data from the packet. </p>

</div>
</div>
<a id="aaed01fec1a3eae27a028506195607f82" name="aaed01fec1a3eae27a028506195607f82"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aaed01fec1a3eae27a028506195607f82">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[2/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a1854ca771105fb281edf349fc6507c73" name="a1854ca771105fb281edf349fc6507c73"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1854ca771105fb281edf349fc6507c73">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[3/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">double &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a741849607d428e93c532e11eadcc39f1" name="a741849607d428e93c532e11eadcc39f1"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a741849607d428e93c532e11eadcc39f1">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[4/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">float &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="ae455be24bfd8dbaa4cd5097e0fb70ecd" name="ae455be24bfd8dbaa4cd5097e0fb70ecd"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae455be24bfd8dbaa4cd5097e0fb70ecd">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[5/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Int16 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a663e71b25a9352e3c4ddf4a3ce9db921" name="a663e71b25a9352e3c4ddf4a3ce9db921"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a663e71b25a9352e3c4ddf4a3ce9db921">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[6/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Int32 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="ae76105996a6c2217bb3a4571603e92f6" name="ae76105996a6c2217bb3a4571603e92f6"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae76105996a6c2217bb3a4571603e92f6">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[7/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Int64 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a1c7814f9dbc637986ac498094add5ca5" name="a1c7814f9dbc637986ac498094add5ca5"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a1c7814f9dbc637986ac498094add5ca5">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[8/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Int8 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a60484dff69997db11e2d4ab3704ab921" name="a60484dff69997db11e2d4ab3704ab921"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a60484dff69997db11e2d4ab3704ab921">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[9/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">std::string &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a8621056995c32bcf59809e2aecf08635" name="a8621056995c32bcf59809e2aecf08635"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8621056995c32bcf59809e2aecf08635">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[10/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">std::wstring &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a27d0ae92891dbf8a7914e5d5232940d0" name="a27d0ae92891dbf8a7914e5d5232940d0"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a27d0ae92891dbf8a7914e5d5232940d0">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[11/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classsf_1_1String.html">String</a> &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a6bc20f1be9a63407079e6d26171ac71f" name="a6bc20f1be9a63407079e6d26171ac71f"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a6bc20f1be9a63407079e6d26171ac71f">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[12/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Uint16 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="aa3b0fabe6c14bcfa29bb04844b8bb987" name="aa3b0fabe6c14bcfa29bb04844b8bb987"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa3b0fabe6c14bcfa29bb04844b8bb987">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[13/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Uint32 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a79f7c144fd07a4036ffc7b0870a36613" name="a79f7c144fd07a4036ffc7b0870a36613"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a79f7c144fd07a4036ffc7b0870a36613">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[14/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Uint64 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a48df8986fc24551f1287144d3e990859" name="a48df8986fc24551f1287144d3e990859"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a48df8986fc24551f1287144d3e990859">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[15/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">Uint8 &amp;&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<a id="a8805e66013f9f84ec8a883e42ae259d4" name="a8805e66013f9f84ec8a883e42ae259d4"></a>
<h2 class="memtitle"><span class="permalink"><a href="#a8805e66013f9f84ec8a883e42ae259d4">&#9670;&#160;</a></span>operator&gt;&gt;() <span class="overload">[16/16]</span></h2>

<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classsf_1_1Packet.html">Packet</a> &amp; sf::Packet::operator&gt;&gt; </td>
          <td>(</td>
          <td class="paramtype">wchar_t *&#160;</td>
          <td class="paramname"><em>data</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. </p>

</div>
</div>
<h2 class="groupheader">Friends And Related Symbol Documentation</h2>
<a id="aa8b32310b01d4bb702d6bcb969d5f130" name="aa8b32310b01d4bb702d6bcb969d5f130"></a>
<h2 class="memtitle"><span class="permalink"><a href="#aa8b32310b01d4bb702d6bcb969d5f130">&#9670;&#160;</a></span>TcpSocket</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classsf_1_1TcpSocket.html">TcpSocket</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="Packet_8hpp_source.html#l00350">350</a> of file <a class="el" href="Packet_8hpp_source.html">Packet.hpp</a>.</p>

</div>
</div>
<a id="ae128c6687ced82c6157c5f865f8dec5c" name="ae128c6687ced82c6157c5f865f8dec5c"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ae128c6687ced82c6157c5f865f8dec5c">&#9670;&#160;</a></span>UdpSocket</h2>

<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">friend class <a class="el" href="classsf_1_1UdpSocket.html">UdpSocket</a></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">friend</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p class="definition">Definition at line <a class="el" href="Packet_8hpp_source.html#l00351">351</a> of file <a class="el" href="Packet_8hpp_source.html">Packet.hpp</a>.</p>

</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="Packet_8hpp_source.html">Packet.hpp</a></li>
</ul>
</div><!-- contents -->
        </div>
        <div id="footer-container">
            <div id="footer">
                SFML is licensed under the terms and conditions of the <a href="https://www.sfml-dev.org/license.php">zlib/png license</a>.<br>
                Copyright &copy; Laurent Gomila &nbsp;::&nbsp;
                Documentation generated by <a href="http://www.doxygen.org/" title="doxygen website">doxygen</a> &nbsp;::&nbsp;
            </div>
        </div>
    </body>
</html>
